function [targetStrings] = HR_PruneTargetSubStrings(targetStrings)
%HR_PruneTargetSubStrings Summary of this function goes here
%   Detailed explanation goes here

temp = targetStrings;
targetStrings = [];
k = 0;
for a = 1:size(temp, 2)
  substring = 0;
  for b = 1:size(temp, 2)
    if (a ~= b)
      if (size(temp(a).string, 2) > size(temp(b).string, 2))
        continue;
      end;

      s1 = temp(a).string;
      s2 = temp(b).string;
      n = size(s1, 2);
      m = size(s2, 2);

      c = 1;
      d = 1;
      started = 0;
      equal = 1;
      while ((c <= n) && (d <= m))
        % find start point of equals
        if (s1(c) == s2(d))
          started = 1;
          if (c == n)
            if equal
              break;
            end
            substring = 1;
            break;
          end
          c = c + 1;
          d = d + 1;
        else
          equal = 0;
          if ~started
            d = d + 1;
          else
            break;
          end
        end
      end
    end
    if substring
      break;
    end
  end
    
  % Only add s1 if it is not a sub-string of s2 (if not already added)
  if ~substring
    k = k + 1;
    targetStrings(k).string = temp(a).string; %#ok<AGROW>
  end
end
end